//
//  Home_ZP_04CollectionViewCell.m
//  MagicBox
//
//  Created by dllo on 16/8/11.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "Home_ZP_04CollectionViewCell.h"
#import "HomePage.h"
@interface Home_ZP_04CollectionViewCell()
@property (nonatomic, retain) UILabel *titleLabel;
@property (nonatomic, retain) UIImageView *imageUrl;

@end
@implementation Home_ZP_04CollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self){
        self.titleLabel = [[UILabel alloc]init];
        [self.contentView addSubview:_titleLabel];
        
        self.imageUrl = [[UIImageView alloc]init];
        [self.contentView addSubview:_imageUrl];
        
        
    }
    return self;
}


-(void)layoutSubviews{
    [super layoutSubviews];
    
     self.imageUrl.frame = CGRectMake(self.contentView.frame.size.height/4, self.frame.size.height/4, self.contentView.frame.size.width/4*2, self.contentView.frame.size.height/4*2);
    self.titleLabel.frame = CGRectMake(0,self.frame.size.height/4*3, self.contentView.frame.size.width, self.contentView.frame.size.height/4);
    self.titleLabel.textAlignment = 1;
    self.titleLabel.font = [UIFont boldSystemFontOfSize:12];
    
}
-(void)setModel:(HomePage *)model{
    _model = model;
    self.titleLabel.text = _model.name;
    
    
}
-(void)setImageStr:(NSString *)imageStr{
    _imageStr = imageStr;

    self.imageUrl.image = [UIImage imageNamed:_imageStr];
    
    
}

@end
